<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/html/axios.min.js"></script>
    <script src="/html/util.js"></script>

    <script>
        function $(elementId){
            return document.getElementById(elementId);
        }
        function addZc(){
            axios.get("/user/add",{
                params: {
                    acc:$("name").value,
                    pwd:$("pwd").value,
                    email:$("email").value,
                    face:$("face").value,
                    date:$("date").value
                }

            }).then(e=>{
                if (e.data=="ok"){
                    location.href ="login.html"
                }
                else{
                    $("spanNo").innerText="注册失败";

                }
            })
        }
    </script>




</head>
<body>
新用户注册<br>

用户名:<input type="text" id="name"><br>
密码:<input type="password" id="pwd"><br>
密码确认:<input type="password" id="pwd1"><br>
用户邮件:<input type="text" id="email"><br>
头像:<input type="text" id="face"><br>
生日:<input type="text" id="date"><br>
<input type="button" value="注册" onclick="addZc()"><span id="spanNo" style="color: red"></span>


</body>
</html>